File manager - Edit - /home/autoph/public_html/projects/ahg-prf-api/app/Models/SlaLog.php
Back
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class SlaLog extends Model { use HasFactory; /** * The attributes that are NOT mass assignable. * */ protected $guarded = [ ]; /** * The attributes that should be cast. * * @var array<string, string> */ protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'start' => 'datetime', 'end' => 'datetime', ]; protected $appends = [ 'company_name', 'dealership_name', 'department_name', 'user', 'status', ]; public function getCompanyNameAttribute() { $record = Company::find($this->company_id); return $record->name ?? null; } public function getDealershipNameAttribute() { $record = Dealership::find($this->dealership_id); return $record->name ?? null; } public function getDepartmentNameAttribute() { $record = Department::find($this->department_id); return $record->name ?? null; } public function getUserAttribute() { $record = User::find($this->user_id); return $record ?? null; } public function getStatusAttribute() { $record = Status::find($this->status_id); return $record ?? null; } }
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings